import java.util.Scanner;

public class StringDemo8 {
    public static void main(String[] args) {
        //1.输入金额
        int money;
        while (true) {
            Scanner s=new Scanner(System.in);
            System.out.println("请输入金额");
            money=s.nextInt();
            if(money>0&&money<=9999999){
                break;
            }else{
                System.out.println("金额无效");
            }
        }

        //2.奖金额转成大写
        String s1="";
        while(true){
            int ge=money%10;
            s1=getCapitalNumber(ge)+s1;
            money/=10;
            if(money==0)
                break;
        }

        System.out.println(s1);

        //3.在未满7位的前面加零

        for(int j=0;j<7;j++){
            if(s1.length()<7){
                s1="零"+s1;
            }else{
                break;
            }
        }
        System.out.println(s1);
        String s2="";
        //3.增加单位
        String[] arr1={"佰","拾","万","仟","佰","十","元"};
        for(int z=0;z<7;z++){
            s2=s2+(s1.charAt(z)+arr1[z]);
        }
        System.out.println(s2);
    }




    public static String getCapitalNumber(int number){
        String arr[]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
        return arr[number];
    }
}


